/**
 * Copyright © 2018 eqxiu.com 北京中网易企秀科技有限公司  All rights reserved.
 */
package com.eqxiu.iom.msg.dto;

import java.util.List;
import java.util.Map;

/**
 * @author hanweisong
 * @description 行为事件协议体
 * @date 2018/12/6 09:30
 */
public class BehaviorEvent extends Event {

    private static final long serialVersionUID = -3523673092619639533L;

    /**
     * 登录名（行为触发方登录名或消息接收方登录名）（非必填）
     */
    private String loginName;

    /**
     * 用户类型（旧的账号类型）（非必填）
     *
     * 参见：com.eqxiu.user.enums.UserType
     */
    private Byte userType;

    /**
     * 用户身份（一个账号拥有一种身份）（非必填）
     *
     * 参见：com.eqxiu.user.enums.IdentityType
     */
    private Integer identityType;

    /**
     * 用户会员（一个账号可拥有多种会员）（非必填）
     *
     * 参见：com.eqxiu.user.enums.MemberType
     */
    private List<Integer> memberTypes;

    /**
     * 权值 积分规则用到的值，比如：1分/100PV  本次1000PV则权值为 1000/100 = 10（非必填）
     */
    private int weight = 1;

    /**
     * 消息体业务字段map容器（消息体变量）（非必填）
     */
    private Map<String, String> params;

    /**
     * 扩展字段 非必填
     */
    private Map<String, Object> ext;

    public BehaviorEvent() {
        super();
    }

    public BehaviorEvent(String producerCode, String eventCode, String userId, int weight) {
        super(producerCode, eventCode, userId);
        this.weight = weight;
    }

    public BehaviorEvent(String producerCode, String eventCode, String userId, Map<String, String> params) {
        super(producerCode, eventCode, userId);
        this.params = params;
    }

    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    public Byte getUserType() {
        return userType;
    }

    public void setUserType(Byte userType) {
        this.userType = userType;
    }

    public Integer getIdentityType() {
        return identityType;
    }

    public void setIdentityType(Integer identityType) {
        this.identityType = identityType;
    }

    public List<Integer> getMemberTypes() {
        return memberTypes;
    }

    public void setMemberTypes(List<Integer> memberTypes) {
        this.memberTypes = memberTypes;
    }

    public int getWeight() {
        return weight;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }

    public Map<String, String> getParams() {
        return params;
    }

    public void setParams(Map<String, String> params) {
        this.params = params;
    }

    public Map<String, Object> getExt() {
        return ext;
    }

    public void setExt(Map<String, Object> ext) {
        this.ext = ext;
    }

    @Override
    public String toString() {
        return "BehaviorEvent{" +
                "loginName=" + loginName +
                ", userType=" + userType +
                ", identityType=" + identityType +
                ", memberTypes=" + memberTypes +
                ", weight=" + weight +
                ", params=" + params +
                ", ext=" + ext +
                ", producerCode=" + producerCode +
                ", eventCode=" + eventCode +
                ", userId=" + userId +
                ", timestamp=" + timestamp +
                "}";
    }

}
